<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox-content">
        	<form class="form-horizontal m" id="form-weeklyApprove" th:object="${weeklyApprove}">
           		 <input id="approveId" name="approveId" th:field="*{approveId}"  type="hidden">
				<div class="form-group">
					<label class="col-sm-3 control-label">审批状态：</label>
					<div class="col-sm-8">
						<div class="radio-box" th:each="dict : ${@dict.getType('sys_approve_status')}">
							<input type="radio" th:id="${dict.dictCode}" name="leaveStatus" th:value="${dict.dictValue}" th:checked="${dict.isDefault == 'Y' ? true : false}">
							<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-3 control-label">审批意见：</label>
					<div class="col-sm-8">
						<textarea id="opinion" name="opinion" class="form-control" style="height: 100px;"></textarea>
					</div>
				</div>
				<div class="form-group">
					<div class="form-control-static col-sm-offset-9">
						<button type="submit" class="btn btn-primary">提交</button>
						<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
					</div>
				</div>
			</form>
		</div>
    </div>
    <div th:include="include::footer"></div>
    <script type="text/javascript">
		var prefix = ctx + "module/weeklyApprove"
		$("#form-weeklyApprove").validate({
			rules:{
                opinion:{
					required:true,
                    maxlength: 100,
				},
			},
			submitHandler: function(form) {
				$.operate.save(prefix + "/approve", $('#form-weeklyApprove').serialize());
			}
		});
	</script>
</body>
</html>
